﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MastePage/SubEmptyMaster.Master" AutoEventWireup="true" CodeBehind="HalfTransferAdd.aspx.cs" Inherits="BySoft.Web.Site.StockManage.HalfTransferAdd" %>

<%@ MasterType VirtualPath="~/MastePage/SubEmptyMaster.Master" %>
<%@ Register Assembly="OneSoft.Web" Namespace="OneSoft.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register Src="../UserControl/SuggestTextBox2.ascx" TagName="SuggestTextBox2"
    TagPrefix="uc1" %>
<%@ Register Assembly="BySoft.Web.Controls" Namespace="BySoft.Web.Controls" TagPrefix="cc1" %>
<asp:Content ID="cphHeadContent" runat="server" ContentPlaceHolderID="EmptyMasteCPH">
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#tabs").tabs({ show: function (event, ui) { iframeAutoFit(); } });
        });

        function Refreashtab() {
            $("#tabs").tabs({ show: function (event, ui) { iframeAutoFit(); } });
        }


        function FunWorkOrderNo() {
            var billdate = $("#<%=cpBillDate.ClientID%>").val();
            if (billdate == "") {
                ShowTopAlert("提示", "请选择日期！");
                return false;
            }
            ShowTopDialog('选择排程', '../ComPage/QuerySScheduleDetailIDByHalfTransfer.aspx?billdate='+billdate, 'FillProess();', 1000, 600); return false;
        }
        function FillProess() {
            var str = getCookie(dialogReturn_key);
            if (str != null && str != "") {
                str = decodeURIComponent(str);
                var strs = str.split(',');
                if (undefined != strs[0]) {
                    document.getElementById("<%=hdScheduleDetailID.ClientID%>").value = strs[0];
                }
                if (undefined != strs[1]) {
                    document.getElementById("<%=txtScheduleID.ClientID%>").value = strs[1];
                }
                if (undefined != strs[2]) {
                    document.getElementById("<%=txtWorkOrderNo.ClientID%>").value = strs[2];
                }
                if (undefined != strs[3]) {
                    document.getElementById("<%=txtProductID.ClientID%>").value = strs[3];
                }
                if (undefined != strs[4]) {
                    document.getElementById("<%=txtProductName.ClientID%>").value = strs[4];
                }
                if (undefined != strs[5]) {
                    document.getElementById("<%=txtUnit.ClientID%>").value = strs[5];
                }
                if (undefined != strs[6]) {
                    document.getElementById("<%=txtProcessName.ClientID%>").value = strs[6];
                }
                if (undefined != strs[7]) {
                    document.getElementById("<%=hdScheduleProcessID.ClientID%>").value = strs[7];
                }
                if (undefined != strs[8]) {
                    document.getElementById("<%=txtActulProduceNum.ClientID%>").value = strs[8];
                }
            }
            setCookie(dialogReturn_key, "");
        }
        function CheckNumWithDotOne(txtBox) {
            if (txtBox != null && txtBox.value != "") {
                var numFormat = /(^[0-9]\d{0,9}(\.\d{0,4})?$)/;
                var text = txtBox.value;
                if (!numFormat.test(text)) {
                    txtBox.value = 0;
                }
            }
        }
    </script>

    <h1 class="tit">库存管理 >> <a href="HalfTransferList.aspx">半成品流转单</a> >> 新增</h1>
            <div class="tableStyle2">
                <table cellpadding="0" cellspacing="0" id="tBase" runat="server">
                    <tr>
                        <th class="left2">表单号码：
                        </th>
                        <td class="right2">
                            <asp:Label CssClass="lblreadonly" ID="lblHalfTransferID" runat="server"></asp:Label>
                        </td>
                        <th class="left2">日期：
                        </th>
                        <td class="right2">
                             <input class="Wdate" id="cpBillDate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" runat="server" type="text"></input>
                        </td>
                    </tr>
                    <tr>
                        <th class="left2">制单号码：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtWorkOrderNo" runat="server" class="lblreadonly"></asp:TextBox>
                            <asp:HiddenField ID="hdScheduleDetailID" runat="server" />
                            <span style="color: Red">*</span>
                            <asp:RequiredFieldValidator ControlToValidate="txtWorkOrderNo" ID="rfvWorkOrderNo" Display="None" runat="server" ErrorMessage="请选择工令号" ValidationGroup="gSubmit"></asp:RequiredFieldValidator>
                            <a style="cursor: pointer;" onclick="FunWorkOrderNo()">
                                <img src="../App_Themes/Common_CSS/images/dot_14.gif" alt="" /></a>
                        </td>
                        <th class="left2">排程号码：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtScheduleID" runat="server" class="lblreadonly"></asp:TextBox>

                        </td>
                    </tr>
                    <tr>
                        <th class="left2">产品编号：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtProductID" runat="server" class="lblreadonly"></asp:TextBox>
                        </td>
                        <th class="left2">产品名称：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtProductName" runat="server" class="lblreadonly"></asp:TextBox>

                        </td>
                    </tr>
                    <tr>
                        <th class="left2">单位：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtUnit" runat="server" class="lblreadonly"></asp:TextBox>
                        </td>
                        <th class="left2">工序：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtProcessName" runat="server" class="lblreadonly"></asp:TextBox>
                            <asp:HiddenField runat="server" ID="hdScheduleProcessID" />
                        </td>
                    </tr>
                    <tr>
                        <th class="left2">现场库位：</th>
                        <td class="right2"><asp:DropDownList ID="ddlSceneStock" runat="server"></asp:DropDownList></td>
                        <th class="left2">实际生产数量：</th>
                        <td class="right2">
                            <asp:TextBox ID="txtActulProduceNum" onkeyup="CheckNumWithDotOne(this)" runat="server" class="fullHeight"></asp:TextBox>
                            <span style="color: Red">*</span>
                            <asp:RequiredFieldValidator ControlToValidate="txtActulProduceNum" ID="RequiredFieldValidator1" Display="None" runat="server" ErrorMessage="请输入实际生产数量" ValidationGroup="gSubmit"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="controlBar" align="center">
                <table cellpadding="0" cellspacing="0" style="width: 300px; margin: 0 auto;">
                    <tr>
                        <td colspan="4">
                            <label class="btnStyleb png_bg">
                                <asp:Button ID="btnSubmit" runat="server" Text="确定"
                                    OnClick="btnSubmit_Click" ValidationGroup="gSubmit" />
                            </label>
                            <label class="btnStylec png_bg">
                                <input type="button" id="Button2" value="返回" runat="server" onclick="window.location = 'MatUseList.aspx'" />
                            </label>
                        </td>
                    </tr>
                </table>
            </div>
</asp:Content>
